from alg221 import Solution

def read_matrix(filename):
    with open(filename, "r") as f:
        lines = f.readlines()
    rows, cols = map(int, lines[0].split())
    matrix = [list(line.strip()) for line in lines[1:]]
    return matrix

if __name__ == "__main__":
    matrix = read_matrix("input221.txt")
    sol = Solution()
    area = sol.maximalSquare(matrix)
    print("最大正方形面积为:", area)
